<%
'GET FORM VALUES
	ID = Request("entryID")
	newLname = Request("lname")
	newFname = Request("fname")
	newAddress = Request("address")
	newCity = Request("city")
	newState = Request("state")
	newZip = Request("zip")
	newPhone = Request("phone")
	newEmail = Request("email")
	
'CONNECT TO DATABASE

	dbPath = "db/contacts.mdb"

	Set conn = Server.CreateObject("ADODB.Connection")
	MdbFilePath = Server.MapPath(dbPath)
	conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"

'INSERT DATA INTO DATABASE
	SQL_stmt = "UPDATE People SET "
	SQL_stmt = SQL_stmt & "LastName='" & newLname & "', FirstName='" & newFname & "', StreetAddress='" & newAddress & "', City='" & newCity & "', State='" & newState & "', ZipCode='" & newZip
	SQL_stmt = SQL_stmt & "', PhoneNo='" & newPhone & "', EmailAddress='" & newEmail & "' "
	SQL_stmt = SQL_stmt & "WHERE (PersonNo=" & ID & ")"
	set RS = conn.execute(SQL_stmt)

'CLOSE DATABASE CONNECTION
	conn.close
	set conn = nothing
	set sqlstmt = nothing

'REDIRECT TO FULL LISTING
	'newPage = "index.asp"
	'Response.Redirect (newPage)
	
	newPage = "edit_contact_success.asp"
	Response.Redirect (newPage)
%>